<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});


Route::group(['prefix' => 'admin'], function () {
    Route::get('index', function () { return view('admin.index');});
    Route::get('userList', function () { return view('admin.user.userList');});
    Route::get('userAdd', function () { return view('admin.user.userAdd');});
    Route::get('userEdit', function () { return view('admin.user.userEdit');});
    Route::get('goodsList', function () { return view('admin.goods.goodsList');});
    Route::get('goodsAdd', function () { return view('admin.goods.goodsAdd');});
    Route::get('goodsEdit', function () { return view('admin.goods.goodsEdit');});

});

Route::get('index',function(){
    return view('index.index');
});

    Route::get('storeList', function () { return view('admin.store.storeList');});
    Route::get('storeAdd', function () { return view('admin.store.storeAdd');});
    Route::get('storeEdit', function () { return view('admin.store.storeEdit');});
    Route::get('mealList', function () { return view('admin.meal.mealList');});
    Route::get('mealAdd', function () { return view('admin.meal.mealAdd');});
    Route::get('mealEdit', function () { return view('admin.meal.mealEdit');});
    Route::get('cateList', 'Admin\CateController@index');
    Route::get('cateAdd', 'Admin\CateController@add');
    Route::post('cateAddAction', 'Admin\CateController@addAction');
    Route::get('cateEdit/{id}', 'Admin\CateController@edit');
    Route::post('cateEditAction', 'Admin\CateController@editAction');
    Route::get('cateDel/{id}', 'Admin\CateController@del');
    Route::get('orderList', function () { return view('admin.order.orderList');});
    Route::get('orderEdit', function () { return view('admin.order.orderEdit');});
    Route::get('addressList', function () { return view('admin.address.addressList');});
    Route::get('addressEdit', function () { return view('admin.address.addressEdit');});
});


Route::get('index', 'Index\IndexController@index');
Route::post('index', 'Index\LoginController@login');


Route::get('forget',function(){
    return view('index.forget');
});

Route::get('register',function(){
    return view('index.register');
});


Auth::routes();

Route::get('/home', 'HomeController@index');

